<h2>Problem 214</h2>
<div style="color:#666;font-size:80%;">25 October 2008</div><br />
<div class="problem_content">
<p>Let &phi; be Euler's totient function, i.e. for a natural number <var>n</var>,
&phi;(<var>n</var>) is the number of <var>k</var>, 1 <img src='images/symbol_le.gif' width='10' height='12' alt='&le;' border='0' style='vertical-align:middle;' /> <var>k</var> <img src='images/symbol_le.gif' width='10' height='12' alt='&le;' border='0' style='vertical-align:middle;' /> <var>n</var>, for which gcd(<var>k</var>,<var>n</var>) = 1.</p>

<p>By iterating &phi;, each positive integer generates a decreasing chain of numbers ending in 1.<br />
E.g. if we start with 5 the sequence 5,4,2,1 is generated.<br />
Here is a listing of all chains with length 4:</p>

<div style="text-align:right; margin-right:350px;">
5,4,2,1<br />
7,6,2,1<br />
8,4,2,1<br />
9,6,2,1<br />
10,4,2,1<br />
12,4,2,1<br />
14,6,2,1<br />
18,6,2,1</div>

<p>Only two of these chains start with a prime, their sum is 12.</p>

<p>What is the sum of all primes less than 40000000 which generate a chain of length 25?</p>



</div><br />
